import React, { Component } from 'react';
import './css/musicItem.css'
import { Link } from 'react-router-dom'

class MusicItem extends Component {
    render() {
        return (
            // <div className='item' onClick={this.handleDetailClick.bind(this, this.props.item.id)}>
            <Link className='item' to={`/music/detail?id=${this.props.item.id}`}>
                <img src={this.props.item.coverImgUrl} alt="" />
                <div>{this.props.item.name}</div>
            </Link>
            // {/* </div> */}
        );
    }
    handleDetailClick(aid) {
        console.log(aid);
    }
}

export default MusicItem;
